using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Resources;
using System.Windows.Forms;
using FlexCell;
using Infragistics.Win.UltraWinTabControl;
using PluginFrame;

namespace PcrExperimentProject
{
	public class FormProjectOption : Form
	{
		protected IApplication mApplication;

		protected IPcrLogService mPcrLogService;

		protected IConfigurationService mConfigurationService;

		protected IMiscService mMiscService;

		protected IPcrOptionService mPcrOptionService;

		protected IPcrExperimentProjectService mPcrProjectService;

		protected IChannelConfiguration[] mChannelConfigurations;

		protected List<IChannelConfiguration> mSelectedChannels;

		protected Grid mItemGrid;

		protected IPcrExperimentProject mExperimentProject;

		protected ResourceManager mResourceManager;

		protected int mCurrentRowCount;

		protected UltraTabControl mTabProjectType;

		protected bool mIsChange;

		protected IContainer components;

		protected Panel panelButtons;

		protected Label label1;

		protected Button btnCancel;

		protected Button btnConfirm;

		protected Panel panelInformation;

		protected TextBox txtProjectName;

		protected ComboBox cmbExperimentType;

		protected Label lblExperimentType;

		protected TextBox txtRemark;

		protected Label lblProjectName;

		protected Label lblRemark;

		protected Button btnSaveAsPath;

		protected Label lblPath;

		protected TextBox txtSaveAsPath;

		protected Panel panel1;

		protected GroupBox grpControlMode;

		protected RadioButton rdbTubeControl;

		protected RadioButton rdbBlockControl;

		protected Label lblReactionVolume;

		protected GroupBox grpItem;

		protected NumericUpDown numVolume;

		protected Label lblUnit;

		protected TextBox txtUnit;

		protected Button btnAdvancedOption;

		public IPcrExperimentProject ExperimentProject
		{
			get
			{
				return mExperimentProject;
			}
		}

		public FormProjectOption(IApplication app, PcrSystemType systemType)
		{
			mApplication = app;
			InitializeComponent();
			mPcrLogService = (IPcrLogService)mApplication.GetService("PcrLogService");
			mConfigurationService = (IConfigurationService)mApplication.GetService("ConfigurationService");
			mMiscService = (IMiscService)mApplication.GetService("MiscService");
			mPcrOptionService = (IPcrOptionService)mApplication.GetService("PcrOptionService");
			mPcrProjectService = (IPcrExperimentProjectService)mApplication.GetService("PcrExperimentProjectService");
			mResourceManager = ResourceManager.CreateFileBasedResourceManager("PcrExperimentProject", mApplication.GetResourceFolder() + GetType().Namespace + "\\", null);
			mExperimentProject = mPcrProjectService.CreateNewEmptyProject(systemType);
		}

		protected virtual void InitializeFormControl()
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			InitializeProjectName();
			InitializeExperimentType();
			InitializeItemGrid();
			txtUnit.Text = mExperimentProject.Unit;
			cmbExperimentType.SelectedIndexChanged += cmbExperimentType_SelectedIndexChanged;
			cmbExperimentType.SelectedValue = mExperimentProject.SystemType;
			mItemGrid = (Grid)mTabProjectType.SelectedTab.TabPage.Controls[0];
			RefreshFormDisplay(mExperimentProject.SystemType);
		}

		protected virtual void InitializeProjectName()
		{
			txtProjectName.MaxLength = mConfigurationService.MaxExperimentNameLength;
			txtProjectName.Text = "Project_" + mMiscService.TimeToFileFormatString(DateTime.Now, "_");
			txtSaveAsPath.Text = mApplication.GetAssemblyPath() + mConfigurationService.ProjectFileDefaultFolder + "\\";
		}

		protected virtual void InitializeExperimentType()
		{
			DataTable pcrSystemTypeTable = mConfigurationService.PcrSystemTypeTable;
			cmbExperimentType.ValueMember = "Type Enum";
			cmbExperimentType.DisplayMember = "Type Name";
			cmbExperimentType.DataSource = pcrSystemTypeTable;
			EnabledExpeimentType(true);
		}

		protected virtual void InitializeProjectChannel()
		{
		}

		protected virtual void GenerateChannelGrid(List<bool> isChannelSelected)
		{
		}

		protected virtual void InitializeItemGrid()
		{
			mChannelConfigurations = mConfigurationService.ChannelConfigurations();
			mSelectedChannels = new List<IChannelConfiguration>();
			mTabProjectType = mPcrProjectService.CreateItemGridTabControl();
			Control control = mTabProjectType.Tabs[0].TabPage.Controls[0];
			Grid abosulteItemGridEvent = (Grid)(object)((control is Grid) ? control : null);
			SetAbosulteItemGridEvent(abosulteItemGridEvent);
			mIsChange = false;
			panel1.SuspendLayout();
			grpItem.Controls.Add(mTabProjectType);
			panel1.ResumeLayout();
		}

		private void SetAbosulteItemGridEvent(Grid itemGrid)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			if (itemGrid != null)
			{
				ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
				ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem();
				toolStripMenuItem.Name = "DeleteTube";
				toolStripMenuItem.Text = mResourceManager.GetString("DeleteTubeString");
				toolStripMenuItem.Click += menuDeleteTube_Click;
				contextMenuStrip.Items.Add(toolStripMenuItem);
				((Control)(object)itemGrid).Tag = contextMenuStrip;
				itemGrid.MouseUp += new MouseUpEventHandler(mItemGrid_MouseUp);
				itemGrid.CellChange += new CellChangeEventHandler(mItemGrid_CellChange);
			}
		}

		private void menuDeleteTube_Click(object sender, EventArgs e)
		{
			try
			{
				mItemGrid.Selection.DeleteByRow();
				mExperimentProject.TubeCount--;
				mPcrProjectService.RefreshAbsoluteGridTargetNameDisplay(mItemGrid);
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void mItemGrid_MouseUp(object sender, MouseEventArgs e)
		{
			try
			{
				if (e.Button == MouseButtons.Right)
				{
					Grid val = (Grid)((sender is Grid) ? sender : null);
					if (val.Selection != null && val.Rows > 4 && val.Selection.FirstRow == val.Selection.LastRow && val.Selection.FirstCol == 1 && val.Selection.LastCol == val.Cols - 1 && val.Selection.FirstRow >= 3)
					{
						new Point(e.X, e.Y);
						ContextMenuStrip contextMenuStrip = ((Control)(object)val).Tag as ContextMenuStrip;
						contextMenuStrip.Show((Control)(object)val, e.Location);
					}
				}
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void mItemGrid_CellChange(object sender, CellChangeEventArgs e)
		{
			mIsChange = true;
		}

		protected virtual void InitializeProgramControlType()
		{
			rdbBlockControl.Checked = true;
			rdbTubeControl.Checked = false;
			numVolume.Value = Convert.ToDecimal(mConfigurationService.DefualtReactionVolume);
			numVolume.Maximum = Convert.ToDecimal(mConfigurationService.MaxReactionVolume);
			numVolume.Minimum = Convert.ToDecimal(mConfigurationService.MinReactionVolume);
			numVolume.Enabled = rdbTubeControl.Checked;
			SetReactionVolumeEnabled(!rdbBlockControl.Checked);
		}

		protected void SetReactionVolumeEnabled(bool isEnabled)
		{
			lblReactionVolume.Enabled = isEnabled;
			numVolume.Enabled = isEnabled;
		}

		protected virtual bool CheckProjectInformation(PcrSystemType systemType)
		{
			if (!CheckProjectName(txtProjectName.Text.Trim()))
			{
				txtProjectName.Focus();
				txtProjectName.SelectAll();
				return false;
			}
			if (!CheckExperimentType())
			{
				return false;
			}
			if (!CheckProjectSavePath())
			{
				MessageBox.Show(mResourceManager.GetString("ProjectPathInvalid"), mResourceManager.GetString("ErrorString"));
				txtSaveAsPath.Focus();
				txtSaveAsPath.SelectAll();
				return false;
			}
			switch (systemType)
			{
			case PcrSystemType.AbsoluteAnalysis:
			case PcrSystemType.GeneScan:
				if (!CheckProjectChannel())
				{
					return false;
				}
				break;
			case PcrSystemType.Allele:
				if (!CheckAlleleProjectChannel())
				{
					return false;
				}
				break;
			default:
			{
				int num = 2;
				break;
			}
			}
			if (CheckProjectFileExisted())
			{
				DialogResult dialogResult = MessageBox.Show(mResourceManager.GetString("ProjectOverwrite"), mResourceManager.GetString("HintString"), MessageBoxButtons.YesNo);
				if (dialogResult == DialogResult.No)
				{
					txtProjectName.Focus();
					txtProjectName.SelectAll();
					return false;
				}
			}
			return true;
		}

		protected virtual bool CheckProjectChannel()
		{
			bool flag = true;
			for (int i = 1; i < mItemGrid.Cols; i++)
			{
				if (!mItemGrid.Cell(2, i).BooleanValue)
				{
					continue;
				}
				flag = false;
				for (int j = 3; j < mItemGrid.Rows; j++)
				{
					mItemGrid.Cell(j, i).Text = mItemGrid.Cell(j, i).Text.Trim();
					if (string.IsNullOrEmpty(mItemGrid.Cell(j, i).Text))
					{
						MessageBox.Show(mResourceManager.GetString("TargetNameEmpty"), mResourceManager.GetString("ErrorString"));
						mItemGrid.Cell(j, i).SetFocus();
						return false;
					}
					if (mItemGrid.Cell(j, i).Text.IndexOf(",") >= 0)
					{
						MessageBox.Show("\",\"" + mResourceManager.GetString("NotWrittenInTargetNameString"), mResourceManager.GetString("ErrorString"));
						mItemGrid.Cell(j, i).SetFocus();
						return false;
					}
					if (mItemGrid.Cell(j, i).Text.IndexOf(" ") >= 0)
					{
						MessageBox.Show(mResourceManager.GetString("SpaceString") + mResourceManager.GetString("NotWrittenInTargetNameString"), mResourceManager.GetString("ErrorString"));
						mItemGrid.Cell(j, i).SetFocus();
						return false;
					}
				}
			}
			if (flag)
			{
				MessageBox.Show(mResourceManager.GetString("TargetNameEmpty"), mResourceManager.GetString("ErrorString"));
				return false;
			}
			for (int k = 1; k < mItemGrid.Cols; k++)
			{
				if (!mItemGrid.Cell(2, k).BooleanValue)
				{
					continue;
				}
				for (int l = 3; l < mItemGrid.Rows; l++)
				{
					if (mItemGrid.Cell(l, k).Text.Equals("N/A"))
					{
						continue;
					}
					for (int m = l + 1; m < mItemGrid.Rows; m++)
					{
						if (mItemGrid.Cell(l, k).Text.Equals(mItemGrid.Cell(m, k).Text))
						{
							MessageBox.Show(mResourceManager.GetString("SameProjectItemName"), mResourceManager.GetString("ErrorString"));
							mItemGrid.Cell(l, k).SetFocus();
							return false;
						}
					}
					for (int n = k + 1; n < mItemGrid.Cols; n++)
					{
						if (!mItemGrid.Cell(2, n).BooleanValue)
						{
							continue;
						}
						for (int num = 3; num < mItemGrid.Rows; num++)
						{
							if (mItemGrid.Cell(l, k).Text.Equals(mItemGrid.Cell(num, n).Text))
							{
								MessageBox.Show(mResourceManager.GetString("SameProjectItemName"), mResourceManager.GetString("ErrorString"));
								mItemGrid.Cell(l, k).SetFocus();
								return false;
							}
						}
					}
				}
			}
			for (int num2 = 3; num2 < mItemGrid.Rows; num2++)
			{
				for (int num3 = 1; num3 < mItemGrid.Cols; num3++)
				{
					if (!mItemGrid.Cell(2, num3).BooleanValue || string.IsNullOrEmpty(mItemGrid.Cell(num2, num3).Text) || mItemGrid.Cell(num2, num3).Text.Equals("N/A"))
					{
						continue;
					}
					for (int num4 = 1; num4 < mItemGrid.Cols; num4++)
					{
						if (num3 != num4 && mItemGrid.Cell(num2, num3).Text.Equals(mItemGrid.Cell(num2, num4).Text) && mItemGrid.Cell(2, num4).BooleanValue)
						{
							MessageBox.Show(mResourceManager.GetString("SameProjectItemName"), mResourceManager.GetString("ErrorString"));
							mItemGrid.Cell(num2, num3).SetFocus();
							return false;
						}
					}
				}
			}
			return true;
		}

		protected virtual bool CheckAlleleProjectChannel()
		{
			for (int i = 0; i < mItemGrid.Rows; i++)
			{
				if (string.IsNullOrEmpty(mItemGrid.Cell(i, 1).Text.Trim()))
				{
					MessageBox.Show(mResourceManager.GetString("TargetNameEmpty"), mResourceManager.GetString("ErrorString"));
					return false;
				}
				for (int j = i + 1; j < mItemGrid.Rows; j++)
				{
					if (i != j && mItemGrid.Cell(i, 1).Text.Trim().Equals(mItemGrid.Cell(j, 1).Text.Trim()))
					{
						MessageBox.Show(mResourceManager.GetString("SamAlleleTargetName"), mResourceManager.GetString("ErrorString"));
						return false;
					}
				}
				if (string.IsNullOrEmpty(mItemGrid.Cell(i, 2).Text.Trim()))
				{
					MessageBox.Show(mResourceManager.GetString("ChannelNameEmpty"), mResourceManager.GetString("ErrorString"));
					return false;
				}
				if (string.IsNullOrEmpty(mItemGrid.Cell(i, 3).Text.Trim()))
				{
					MessageBox.Show("Empty Dye", mResourceManager.GetString("ErrorString"));
					return false;
				}
			}
			return true;
		}

		protected virtual bool CheckProjectName(string projectName)
		{
			if (projectName.Length <= 0)
			{
				MessageBox.Show(mResourceManager.GetString("ProjectNameEmpty"), mResourceManager.GetString("ErrorString"));
				return false;
			}
			char[] invalidFileNameChars = Path.GetInvalidFileNameChars();
			int num = projectName.IndexOfAny(invalidFileNameChars);
			if (num != -1)
			{
				string text = projectName.Substring(num, 1);
				MessageBox.Show(mResourceManager.GetString("InvalidCharacter") + "('" + text + "')! " + mResourceManager.GetString("ReInputFileName"), mResourceManager.GetString("ErrorString"));
				return false;
			}
			return true;
		}

		protected virtual bool CheckProjectSavePath()
		{
			return mMiscService.CheckPathIsExist(txtSaveAsPath.Text, true);
		}

		protected virtual bool CheckProjectFileExisted()
		{
			string text = txtSaveAsPath.Text + txtProjectName.Text + ".prj";
			if (text.Equals(mExperimentProject.Name))
			{
				return false;
			}
			return File.Exists(text);
		}

		private bool CheckExperimentType()
		{
			return true;
		}

		public void EnabledExpeimentType(bool isEnable)
		{
			lblExperimentType.Enabled = isEnable;
			cmbExperimentType.Enabled = isEnable;
		}

		protected void btnConfirm_Click(object sender, EventArgs e)
		{
			PcrSystemType pcrSystemType = (PcrSystemType)cmbExperimentType.SelectedValue;
			if (CheckProjectInformation(pcrSystemType))
			{
				mExperimentProject = CreateProject(pcrSystemType);
				mExperimentProject.FileName = txtSaveAsPath.Text + txtProjectName.Text + ".prj";
				mExperimentProject.Name = txtProjectName.Text;
				mExperimentProject.Remark = txtRemark.Text;
				mExperimentProject.TemperatureControlType = ((!rdbBlockControl.Checked) ? TemperatureControlType.Tube : TemperatureControlType.Block);
				mExperimentProject.ReactionVolume = (double)numVolume.Value;
				mExperimentProject.Unit = txtUnit.Text;
				if (!(this is FormEditProjectOption))
				{
					mConfigurationService.DefaultProjectType = pcrSystemType;
				}
				base.DialogResult = DialogResult.OK;
				Close();
			}
		}

		protected virtual IPcrExperimentProject CreateProject(PcrSystemType systemType)
		{
			mExperimentProject = mPcrProjectService.CreateNewEmptyProject(systemType);
			CreateProjectItems(systemType);
			return mExperimentProject;
		}

		protected void CreateProjectItems(PcrSystemType systemType)
		{
			switch (systemType)
			{
			case PcrSystemType.AbsoluteAnalysis:
				CreateAbsoluteProject(mExperimentProject);
				break;
			case PcrSystemType.Allele:
				CreateAlleleProject(mExperimentProject);
				break;
			case PcrSystemType.GeneScan:
				CreateAbsoluteProject(mExperimentProject);
				break;
			}
		}

		private void CreateAbsoluteProject(IPcrExperimentProject experimentProject)
		{
			experimentProject.TubeCount = mItemGrid.Rows - 3;
			for (int i = 1; i < mItemGrid.Cols; i++)
			{
				if (mItemGrid.Cell(2, i).BooleanValue)
				{
					string text = string.Empty;
					for (int j = 3; j < mItemGrid.Rows; j++)
					{
						text = text + mItemGrid.Cell(j, i).Text + ",";
					}
					if (text.EndsWith(","))
					{
						text = text.Substring(0, text.Length - 1);
					}
					experimentProject.CreateProjectItem(i - 1, text, experimentProject.TubeCount);
					experimentProject.ChannelConfigurations[i - 1].IsSelected = true;
					experimentProject.ProjectPropertyList[i - 1].ProjectName = text;
				}
				else
				{
					experimentProject.ChannelConfigurations[i - 1].IsSelected = false;
					experimentProject.ProjectPropertyList[i - 1].ProjectName = string.Empty;
				}
				experimentProject.ProjectPropertyList[i - 1].Description = experimentProject.ChannelConfigurations[i - 1].Position.ToString();
			}
		}

		private void CreateAlleleProject(IPcrExperimentProject experimentProject)
		{
			experimentProject.TubeCount = 1;
			for (int i = 0; i < experimentProject.ProjectItems.Length; i++)
			{
				experimentProject.ChannelConfigurations[i].IsSelected = false;
				experimentProject.ProjectPropertyList[i].ProjectName = string.Empty;
			}
			for (int j = 1; j < mItemGrid.Rows; j++)
			{
				int num = Convert.ToInt32(mItemGrid.Cell(j, 2).Text) - 1;
				string text = mItemGrid.Cell(j, 1).Text.Trim();
				experimentProject.CreateProjectItem(num, text, experimentProject.TubeCount);
				experimentProject.ChannelConfigurations[num].IsSelected = true;
				experimentProject.ProjectPropertyList[num].ProjectName = text;
				experimentProject.ProjectPropertyList[num].Description = experimentProject.ChannelConfigurations[num].Position.ToString();
			}
		}

		protected void btnCancel_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Cancel;
			Close();
		}

		protected void btnSaveAsPath_Click(object sender, EventArgs e)
		{
			try
			{
				txtSaveAsPath.Text = txtSaveAsPath.Text.Trim();
				FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
				folderBrowserDialog.ShowNewFolderButton = true;
				if (txtSaveAsPath.Text.Length == 0)
				{
					folderBrowserDialog.SelectedPath = mApplication.GetAssemblyPath() + mConfigurationService.ProjectFileDefaultFolder + "\\";
				}
				else if (mMiscService.CheckPathIsExist(txtSaveAsPath.Text))
				{
					folderBrowserDialog.SelectedPath = txtSaveAsPath.Text;
				}
				else
				{
					folderBrowserDialog.SelectedPath = mApplication.GetAssemblyPath() + mConfigurationService.ProjectFileDefaultFolder + "\\";
				}
				folderBrowserDialog.Description = mResourceManager.GetString("SaveProjectFileTo") + folderBrowserDialog.SelectedPath;
				if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
				{
					txtSaveAsPath.Text = folderBrowserDialog.SelectedPath + "\\";
				}
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void txtProgramName_Click(object sender, EventArgs e)
		{
			try
			{
				txtProjectName.Select(0, txtProjectName.Text.Length);
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void rdbBlockControl_CheckedChanged(object sender, EventArgs e)
		{
			SetReactionVolumeEnabled(!rdbBlockControl.Checked);
		}

		protected void FormProgramOption_FormClosing(object sender, FormClosingEventArgs e)
		{
			try
			{
				if (base.DialogResult == DialogResult.Cancel && mIsChange)
				{
					DialogResult dialogResult = MessageBox.Show(mResourceManager.GetString("ExitWithoutSave"), mResourceManager.GetString("HintString"), MessageBoxButtons.YesNo);
					if (dialogResult == DialogResult.No)
					{
						e.Cancel = true;
					}
				}
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void FormProjectOption_Load(object sender, EventArgs e)
		{
			try
			{
				InitializeFormControl();
				if (!mExperimentProject.IsPasswordMatch && mExperimentProject.ZonePasswordStatus[4])
				{
					SetOptionEnabled(false);
				}
				mIsChange = false;
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void SetOptionEnabled(bool isEnabled)
		{
			txtProjectName.Enabled = isEnabled;
			txtSaveAsPath.Enabled = isEnabled;
			btnSaveAsPath.Enabled = isEnabled;
			txtRemark.Enabled = isEnabled;
			txtUnit.Enabled = isEnabled;
			grpItem.Enabled = isEnabled;
			btnAdvancedOption.Enabled = isEnabled;
			btnConfirm.Enabled = isEnabled;
		}

		private void btnAdvancedOption_Click(object sender, EventArgs e)
		{
			try
			{
				int tubeCount = mItemGrid.Rows - 3;
				FormProjectAdvancedOption formProjectAdvancedOption = new FormProjectAdvancedOption(tubeCount, string.Empty);
				if (formProjectAdvancedOption.ShowDialog() == DialogResult.OK)
				{
					mExperimentProject.TubeCount = formProjectAdvancedOption.GetTubeCount();
					mItemGrid.Rows = 3 + mExperimentProject.TubeCount;
					if (mItemGrid.Rows < 4)
					{
						mItemGrid.Rows = 4;
					}
					mPcrProjectService.RefreshAbsoluteGridTargetNameDisplay(mItemGrid);
					mExperimentProject.TubeCount = tubeCount;
				}
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		protected void RefreshFormDisplay(PcrSystemType systemType)
		{
			switch (systemType)
			{
			case PcrSystemType.AbsoluteAnalysis:
				btnAdvancedOption.Enabled = true;
				txtUnit.Enabled = true;
				lblUnit.Enabled = true;
				break;
			case PcrSystemType.GeneScan:
			case PcrSystemType.Allele:
				btnAdvancedOption.Enabled = false;
				txtUnit.Enabled = false;
				lblUnit.Enabled = false;
				txtUnit.Text = string.Empty;
				break;
			}
		}

		protected void cmbExperimentType_SelectedIndexChanged(object sender, EventArgs e)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			try
			{
				mIsChange = true;
				mTabProjectType.SelectedTab = mTabProjectType.Tabs[cmbExperimentType.SelectedIndex];
				mItemGrid = (Grid)mTabProjectType.SelectedTab.TabPage.Controls[0];
				RefreshFormDisplay((PcrSystemType)cmbExperimentType.SelectedValue);
			}
			catch (Exception ex)
			{
				mPcrLogService.ShowExceptionDialogBox(ex);
			}
		}

		private void txtProjectName_TextChanged(object sender, EventArgs e)
		{
			mIsChange = true;
		}

		private void txtSaveAsPath_TextChanged(object sender, EventArgs e)
		{
			mIsChange = true;
		}

		private void txtRemark_TextChanged(object sender, EventArgs e)
		{
			mIsChange = true;
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		protected void InitializeComponent()
		{
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PcrExperimentProject.FormProjectOption));
			this.panelButtons = new System.Windows.Forms.Panel();
			this.btnAdvancedOption = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnConfirm = new System.Windows.Forms.Button();
			this.panelInformation = new System.Windows.Forms.Panel();
			this.txtSaveAsPath = new System.Windows.Forms.TextBox();
			this.txtProjectName = new System.Windows.Forms.TextBox();
			this.cmbExperimentType = new System.Windows.Forms.ComboBox();
			this.lblExperimentType = new System.Windows.Forms.Label();
			this.txtRemark = new System.Windows.Forms.TextBox();
			this.lblProjectName = new System.Windows.Forms.Label();
			this.lblRemark = new System.Windows.Forms.Label();
			this.btnSaveAsPath = new System.Windows.Forms.Button();
			this.lblPath = new System.Windows.Forms.Label();
			this.panel1 = new System.Windows.Forms.Panel();
			this.grpItem = new System.Windows.Forms.GroupBox();
			this.grpControlMode = new System.Windows.Forms.GroupBox();
			this.txtUnit = new System.Windows.Forms.TextBox();
			this.lblUnit = new System.Windows.Forms.Label();
			this.numVolume = new System.Windows.Forms.NumericUpDown();
			this.rdbTubeControl = new System.Windows.Forms.RadioButton();
			this.rdbBlockControl = new System.Windows.Forms.RadioButton();
			this.lblReactionVolume = new System.Windows.Forms.Label();
			this.panelButtons.SuspendLayout();
			this.panelInformation.SuspendLayout();
			this.panel1.SuspendLayout();
			this.grpControlMode.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)this.numVolume).BeginInit();
			base.SuspendLayout();
			this.panelButtons.Controls.Add(this.btnAdvancedOption);
			this.panelButtons.Controls.Add(this.label1);
			this.panelButtons.Controls.Add(this.btnCancel);
			this.panelButtons.Controls.Add(this.btnConfirm);
			resources.ApplyResources(this.panelButtons, "panelButtons");
			this.panelButtons.ForeColor = System.Drawing.SystemColors.ControlText;
			this.panelButtons.Name = "panelButtons";
			resources.ApplyResources(this.btnAdvancedOption, "btnAdvancedOption");
			this.btnAdvancedOption.Name = "btnAdvancedOption";
			this.btnAdvancedOption.UseVisualStyleBackColor = true;
			this.btnAdvancedOption.Click += new System.EventHandler(btnAdvancedOption_Click);
			this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			resources.ApplyResources(this.label1, "label1");
			this.label1.Name = "label1";
			resources.ApplyResources(this.btnCancel, "btnCancel");
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.UseVisualStyleBackColor = true;
			this.btnCancel.Click += new System.EventHandler(btnCancel_Click);
			resources.ApplyResources(this.btnConfirm, "btnConfirm");
			this.btnConfirm.Name = "btnConfirm";
			this.btnConfirm.UseVisualStyleBackColor = true;
			this.btnConfirm.Click += new System.EventHandler(btnConfirm_Click);
			this.panelInformation.Controls.Add(this.txtSaveAsPath);
			this.panelInformation.Controls.Add(this.txtProjectName);
			this.panelInformation.Controls.Add(this.cmbExperimentType);
			this.panelInformation.Controls.Add(this.lblExperimentType);
			this.panelInformation.Controls.Add(this.txtRemark);
			this.panelInformation.Controls.Add(this.lblProjectName);
			this.panelInformation.Controls.Add(this.lblRemark);
			this.panelInformation.Controls.Add(this.btnSaveAsPath);
			this.panelInformation.Controls.Add(this.lblPath);
			resources.ApplyResources(this.panelInformation, "panelInformation");
			this.panelInformation.Name = "panelInformation";
			this.txtSaveAsPath.BackColor = System.Drawing.Color.White;
			resources.ApplyResources(this.txtSaveAsPath, "txtSaveAsPath");
			this.txtSaveAsPath.Name = "txtSaveAsPath";
			this.txtSaveAsPath.ReadOnly = true;
			this.txtSaveAsPath.TextChanged += new System.EventHandler(txtSaveAsPath_TextChanged);
			this.txtProjectName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
			this.txtProjectName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
			resources.ApplyResources(this.txtProjectName, "txtProjectName");
			this.txtProjectName.Name = "txtProjectName";
			this.txtProjectName.TextChanged += new System.EventHandler(txtProjectName_TextChanged);
			this.txtProjectName.Click += new System.EventHandler(txtProgramName_Click);
			this.cmbExperimentType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			resources.ApplyResources(this.cmbExperimentType, "cmbExperimentType");
			this.cmbExperimentType.FormattingEnabled = true;
			this.cmbExperimentType.Name = "cmbExperimentType";
			resources.ApplyResources(this.lblExperimentType, "lblExperimentType");
			this.lblExperimentType.Name = "lblExperimentType";
			this.txtRemark.AcceptsReturn = true;
			resources.ApplyResources(this.txtRemark, "txtRemark");
			this.txtRemark.Name = "txtRemark";
			this.txtRemark.TextChanged += new System.EventHandler(txtRemark_TextChanged);
			resources.ApplyResources(this.lblProjectName, "lblProjectName");
			this.lblProjectName.Name = "lblProjectName";
			resources.ApplyResources(this.lblRemark, "lblRemark");
			this.lblRemark.Name = "lblRemark";
			resources.ApplyResources(this.btnSaveAsPath, "btnSaveAsPath");
			this.btnSaveAsPath.Name = "btnSaveAsPath";
			this.btnSaveAsPath.UseVisualStyleBackColor = true;
			this.btnSaveAsPath.Click += new System.EventHandler(btnSaveAsPath_Click);
			resources.ApplyResources(this.lblPath, "lblPath");
			this.lblPath.Name = "lblPath";
			this.panel1.Controls.Add(this.grpItem);
			this.panel1.Controls.Add(this.grpControlMode);
			resources.ApplyResources(this.panel1, "panel1");
			this.panel1.Name = "panel1";
			resources.ApplyResources(this.grpItem, "grpItem");
			this.grpItem.Name = "grpItem";
			this.grpItem.TabStop = false;
			this.grpControlMode.Controls.Add(this.txtUnit);
			this.grpControlMode.Controls.Add(this.lblUnit);
			this.grpControlMode.Controls.Add(this.numVolume);
			this.grpControlMode.Controls.Add(this.rdbTubeControl);
			this.grpControlMode.Controls.Add(this.rdbBlockControl);
			this.grpControlMode.Controls.Add(this.lblReactionVolume);
			resources.ApplyResources(this.grpControlMode, "grpControlMode");
			this.grpControlMode.Name = "grpControlMode";
			this.grpControlMode.TabStop = false;
			this.txtUnit.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
			this.txtUnit.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
			resources.ApplyResources(this.txtUnit, "txtUnit");
			this.txtUnit.Name = "txtUnit";
			resources.ApplyResources(this.lblUnit, "lblUnit");
			this.lblUnit.Name = "lblUnit";
			resources.ApplyResources(this.numVolume, "numVolume");
			this.numVolume.Name = "numVolume";
			resources.ApplyResources(this.rdbTubeControl, "rdbTubeControl");
			this.rdbTubeControl.Name = "rdbTubeControl";
			this.rdbTubeControl.TabStop = true;
			this.rdbTubeControl.UseVisualStyleBackColor = true;
			resources.ApplyResources(this.rdbBlockControl, "rdbBlockControl");
			this.rdbBlockControl.Name = "rdbBlockControl";
			this.rdbBlockControl.TabStop = true;
			this.rdbBlockControl.UseVisualStyleBackColor = true;
			this.rdbBlockControl.CheckedChanged += new System.EventHandler(rdbBlockControl_CheckedChanged);
			resources.ApplyResources(this.lblReactionVolume, "lblReactionVolume");
			this.lblReactionVolume.Name = "lblReactionVolume";
			resources.ApplyResources(this, "$this");
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.Controls.Add(this.panel1);
			base.Controls.Add(this.panelInformation);
			base.Controls.Add(this.panelButtons);
			base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			base.Name = "FormProjectOption";
			base.ShowIcon = false;
			base.ShowInTaskbar = false;
			base.Load += new System.EventHandler(FormProjectOption_Load);
			base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormProgramOption_FormClosing);
			this.panelButtons.ResumeLayout(false);
			this.panelInformation.ResumeLayout(false);
			this.panelInformation.PerformLayout();
			this.panel1.ResumeLayout(false);
			this.grpControlMode.ResumeLayout(false);
			this.grpControlMode.PerformLayout();
			((System.ComponentModel.ISupportInitialize)this.numVolume).EndInit();
			base.ResumeLayout(false);
		}
	}
}
